package ma.cdm.compteRendu.bo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Point entity. @author Limouri Anouar
 */
@Entity
@Table(name="point")

public class Point  implements java.io.Serializable {

	// Fields

     private Long idpoint;
     private String titrepoint;
     private Set<SuiviPoint> suiviPoints = new HashSet<SuiviPoint>(0);

	// Constructors

	/** default constructor */
	public Point() {
	}

	/** full constructor */
	public Point(String titrepoint, Set<SuiviPoint> suivipoints) {
		this.titrepoint = titrepoint;
		this.suiviPoints = suivipoints;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "IDPOINT", unique = true, nullable = false)
	public Long getIdpoint() {
		return this.idpoint;
	}

	public void setIdpoint(Long idpoint) {
		this.idpoint = idpoint;
	}

	@Column(name = "TITREPOINT", length = 200)
	public String getTitrepoint() {
		return this.titrepoint;
	}

	public void setTitrepoint(String titrepoint) {
		this.titrepoint = titrepoint;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "point")
	public Set<SuiviPoint> getSuivipoints() {
		return this.suiviPoints;
	}

	public void setSuivipoints(Set<SuiviPoint> suivipoints) {
		this.suiviPoints = suivipoints;
	}

}